#include "XMLRequest.h"

namespace http {
  XMLRequest::XMLRequest(const std::map<std::string, std::string> &reqMap, const char *root) {
    xmlNodePtr rootnode, newnode;

    doc = xmlNewDoc(BAD_CAST "1.0");
    rootnode = xmlNewNode(NULL, BAD_CAST root);
    xmlDocSetRootElement(doc, rootnode);

    newnode = xmlNewTextChild (rootnode, NULL, BAD_CAST "reference", NULL);
  }

  std::string XMLRequest::getData() {
    xmlChar *xmlbuff;
    int buffersize;

    xmlDocDumpMemory(doc, &xmlbuff, &buffersize);
    return (char *) xmlbuff;
  }
}
